home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earcd / grafica / video easel / camrexx / beats_me.rexx next >
OS/2 REXX Batch file  |  1995-03-30  |  753b  |  36 lines

  1. /* Beats-me by an idea of Toffoli, in CAMRexx by THOR */
  2.  
  3. MakeAlgorithm:
  4.    PLANEALGORITHM neumann centers
  5. return
  6.  
  7. MakePlane:
  8.    if plane=0 | plane=1 then; do
  9.       select
  10.          when alts=0 then
  11.             beat=norths
  12.          when alts=1 then
  13.             beat=souths
  14.          when alts=2 then
  15.             beat=wests
  16.          when alts=3 then
  17.             beat=easts
  18.       end
  19.       new=centers+1
  20.       if new=4 then
  21.          new=0
  22.       if beat=new then
  23.             SETPLANES new
  24.       else  SETPLANES centers
  25.    end
  26.    if plane=2 then; do
  27.       new=((south & east) ^ west ^ north ^ center) ^ center_
  28.       SETPLANE new
  29.    end
  30.    if plane=3 then; do
  31.       new=((south_ & west_) ^ east_ ^ north_ ^ center_) ^ center
  32.       SETPLANE new
  33.    end
  34. return
  35.  
  36.